package com.studydemo.utils;

import com.studydemo.entity.SysUser;

public class AdministratorThreadLocal {
    private static ThreadLocal<SysUser> administratorThreadLocal = new ThreadLocal<>();

    public static void setAdministrator(SysUser sysUser) {
        administratorThreadLocal.set(sysUser);
    }

    public static SysUser getAdministrator() {
        return administratorThreadLocal.get();
    }

    public static void removeAdministrator() {
        administratorThreadLocal.remove();
    }

    public static String getAdministratorName(){
        return administratorThreadLocal.get().getName();
    }

}